public class Second {
    public static void main (String []args) {
        int Max=nums[0];
        int pre=0;
        int cur=0;
        for(int num:nums){
            cur=num;
            if(pre>0){
                cur+=pre;
            }
            if(cur>Max){
                Max=cur;
            }
            pre=cur;
        }
        return Max;
    }
}
